Field of the Invention
The present invention relates to an image forming apparatus, a method of controlling the image forming apparatus, and a storage medium, and more particularly to an image forming apparatus that shifts to a state where quick activation of the apparatus is possible when a power switch is turned off, a method of controlling the image forming apparatus, and a storage medium.
Description of the Related Art
Recent image forming apparatuses and image processing apparatuses suffer from a problem that it takes a long time before becoming capable of being actually operated after having a power switch thereof operated by a user since the apparatuses have come to be equipped with multiple functions.
To solve this problem, there has been proposed an image forming apparatus having a function called “suspend” (suspend mode) which, when the user turns off the power switch, suspends operations of programs and the like being executed such that the apparatus can return to the same operating state as the current operating state.
Further, there has also been proposed an image forming apparatus having a function called “resume” which, when the user turns on the power switch, starts the apparatus in an operating state in which the apparatus was immediately before the preceding shutdown, that is, causes the apparatus to return to a state immediately before the shutdown.
According to the above-described suspend function, the image forming apparatus in a normal operation mode can shift to the suspend mode in which the operations of the respective sections of the image forming apparatus are suspended with the states of the sections immediately before the suspension being held.
Further, according to the above-described resume function, the image forming apparatus in the suspend mode can return to the normal operation mode in a state immediately before shifting to the suspend mode.
That is, by using the functions as described above, the image forming apparatus, such as a digital multifunction peripheral, can achieve quick activation, to quickly return to a state of operation immediately before the shutdown.
If the suspend mode is used for an off operation of the power switch, when the image forming apparatus cannot perform a normal operation suddenly due to a memory leak, an invalid operation process, or the like, the off operation of the power switch cannot cause the image forming apparatus to go through restart processing, which makes it impossible for the image forming apparatus to return from the normal operation disabled state.
To cope with this inconvenience, there has been proposed a method in which when the power switch is turned off, an operating system (OS) of the image forming apparatus is shut down once, and then is restarted to enter the suspend mode (see Japanese Patent Laid-Open Publication No. 2007-293806).
With this method, since the OS is restarted, it is possible to clean up the memory and shift to the suspend mode in a state in which the normal operation disabled state e.g. due to a memory leak is cleared.
However, in the case where the image forming apparatus is configured to restart the OS after executing shutdown thereof, when the power switch is turned off, the shutdown operation and the restart operation take place whenever the power switch is turned off, which causes a problem of increasing time required to shift to the suspend mode.